package com.xique.blelock.view.DeviceManager;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.xique.blelock.R;
import com.xique.blelock.Utils.ACache;
import com.xique.blelock.Utils.Stringkey;
import com.xique.blelock.model.LockAllinfo;
import com.xique.blelock.view.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/12/12.
 */

public class DeviceInfoActivty  extends BaseActivity {



    private LockAllinfo lockAllinfo;


    @BindView(R.id.devicename)
    TextView devicename;
    @BindView(R.id.devicever)
    TextView devicever;

    @BindView(R.id.deviceserial)
    TextView deviceseial;

    @BindView(R.id.devicemacture)
    TextView devicemacture;

    @BindView(R.id.devicevol)
    TextView deviceVol;


    @BindView(R.id.title)
    TextView titile;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.deviceinfolayout);
        ButterKnife.bind(this);
        initView();
    }

    @Override
    protected void initView() {
        super.initView();
        lockAllinfo = (LockAllinfo) ACache.get(this).getAsObject(Stringkey.lockAllinfo);

        devicename.setText(lockAllinfo.getLockName());
        devicever.setText("v" +lockAllinfo.getHardwareVersion());
        deviceseial.setText(lockAllinfo.getSerialNumber());
        devicemacture.setText(lockAllinfo.getVendor());
        deviceVol.setText(lockAllinfo.getLockPower()+"%");

        titile.setText("设备信息");

    }

    @OnClick(R.id.BACKER)
    public void BackLastPage(){
        finish();
    }
}
